<script>
export default {
  name: "hotel",
  props: {
    data: {
      default: () => ({})
    }
  },
  methods: {
    handleClick() {
      this.$emit('click', this.data.Id);
    }
  }
}
</script>

<template>
  <view class="hotel-container" @click="handleClick">
    <image class="room-img" :src="data.Img" mode="aspectFill"></image>
    <view class="room-info">
      <view>
        <text class="name">{{data.Name || ''}}</text>
		<view class="subtitle">
			{{data.Subtitle || ''}}
		</view>
        <view class="feature">
<!--          <text class="bed">{{data.Tags}}</text>-->
<!--          <text class="separator">|</text>-->
<!--          <text class="window">有窗</text>-->
        </view>
      </view>
      <view class="price-wrap">
        <view class="price">
          <text>¥</text>{{data.ShowPrice || "-"}}
<!--          <text class="market-price" v-if="data.MarketPrice">¥{{data.MarketPrice}}</text>-->
        </view>
        <view class="book-btn">订</view>
      </view>
    </view>
  </view>
</template>

<style scoped lang="scss">
.hotel-container {
  position: relative;
  display: flex;
  background-color: #fff;
  border-radius: 16rpx;
  margin-bottom: 20rpx;
  // height: 240rpx;
  min-height: 240rpx;
  align-items: center;
  box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
}

.room-img {
  width: 240rpx;
  height: 240rpx;
  border-radius: 16rpx;
  flex-shrink: 0;
}

.room-info {
  padding: 20rpx;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  min-height: 240rpx;
  
  .name {
    font-size: 30rpx;
    color: #333;
    font-weight: 600;
    margin-bottom: 10rpx;
  }
  
  .feature {
    display: flex;
    align-items: center;
    font-size: 24rpx;
    color: #999;
    margin-bottom: 20rpx;
    
    .separator {
      margin: 0 10rpx;
    }
  }
  .subtitle{
	  font-size: 28rpx;
	  color: #666;
	  padding-top: 10rpx;
  }
  .price-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    
    .price {
      font-size: 36rpx;
      font-weight: 600;
      color: #333;
      
      .market-price {
        font-size: 22rpx;
        color: #999;
        text-decoration: line-through;
        margin-left: 8rpx;
        font-weight: normal;
      }
    }

    text{
      font-size: 24rpx;
    }
  }
  .book-btn {
    position: absolute;
    right: 20rpx;
    bottom: 20rpx;
    width: 56rpx;
    height: 56rpx;
    color: #fff;
    font-size: 28rpx;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(-40deg, #FF6B0D, #FA452D);
    box-shadow: 2rpx 2rpx 5rpx 0 rgba(252,86,31,0.51);
    border-radius: 16rpx 4rpx 16rpx 4rpx;

  }
}
</style>